import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

public class wordF{

    public static void main(String[] args) {
        String filePath = "input.txt"; // 文本文件的路径  
        Map<Character, Integer> letterCount = new HashMap<>();

        try (BufferedReader br = new BufferedReader(new FileReader(filePath))) {
            String line;
            while ((line = br.readLine()) != null) {
                for (char ch : line.toCharArray()) {
                    if (Character.isLetter(ch)) {
                        // 转换为大写以统一统计  
                        ch = Character.toUpperCase(ch);
                        letterCount.put(ch, letterCount.getOrDefault(ch, 0) + 1);
                    }
                }
            }

            // 计算总字母数  
            int totalLetters = letterCount.values().stream().mapToInt(Integer::intValue).sum();

            // 使用TreeMap按照字典序排序，如果频率相同则按字典序  
            TreeMap<Character, Double> sortedFrequencies = new TreeMap<>();
            for (Map.Entry<Character, Integer> entry : letterCount.entrySet()) {
                double frequency = (double) entry.getValue() / totalLetters * 100;
                sortedFrequencies.put(entry.getKey(), Math.round(frequency * 100.0) / 100.0);
            }

            // 输出频率  
            for (Map.Entry<Character, Double> entry : sortedFrequencies.entrySet()) {
                System.out.printf("%c: %.2f%%\n", entry.getKey(), entry.getValue());
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}